<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/sys/header.html">
    <style>
        .upload-list {
            display: inline-block;
            width: 60px;
            height: 60px;
            text-align: center;
            line-height: 60px;
            border: 1px solid transparent;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            position: relative;
            box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
            margin-right: 4px;
        }

        .upload-list img {
            width: 100%;
            height: 100%;
        }



        .upload-list:hover .upload-list-cover {
            display: block;
        }

        .upload-list-cover i {
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            margin: 0 2px;
        }
    </style>
</head>
<body>

<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="buttons-group">
            <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <Tabs value="name1">
            <Tab-Pane label="通用信息" name="name1">
                <i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="100">
                    <Form-item label="名称" prop="name">
                        <i-input v-model="goods.name" placeholder="名称"/>
                    </Form-item>

                    <Form-item label="市场价" prop="marketPrice">
                        <Input-number :min="0" :step="1" v-model="goods.marketPrice" placeholder="市场价"
                                      style="width: 188px;"/>
                    </Form-item>
                    <Form-item label="折扣" prop="discount">
                        <Input-number :min="0" :step="1" v-model="goods.discount" placeholder="折扣" style="width: 188px;"/> 折扣后：<p>1.0</p>
                    </Form-item>
                    <Form-item label="零售价格" prop="retailPrice">
                        <Input-number :min="0" :step="1" v-model="goods.retailPrice" placeholder="折后价格"
                                      style="width: 188px;"/>
                    </Form-item>
                </i-form>
            </Tab-Pane>
            <Tab-Pane label="详细描述" name="name2">

                <template>

                    <Upload
                            ref="upload"
                            :show-upload-list="false"
                            :default-file-list="uploadList"
                            :on-success="handleSuccess"
                            :format="['jpg','jpeg','png']"
                            :max-size="2048"
                            :on-format-error="handleFormatError"
                            :on-exceeded-size="handleMaxSize"
                            :before-upload="handleBeforeUpload"
                            multiple
                            type="drag"
                            action="../sys/oss/upload"
                            style="display: inline-block;width:58px;">
                        <div style="width: 58px;height:58px;line-height: 58px;">
                            <Icon type="camera" size="20"></Icon>
                        </div>
                    </Upload>

                </template>

            </Tab-Pane>
        </Tabs>
        <div style="padding-left: 20px; margin-bottom: 30px">
            <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
            <i-button type="warning" @click="reload" style="margin-left: 8px"/>
            返回</i-button>
        </div>
    </Card>
</div>

<script src="${rc.contextPath}/static/js/shop/discount.js?_${.now?long}"></script>
</body>
</html>
